<table class="table table-bordered" id="webuser-lists-table" data-toggle="datagrid" data-options="{
    tableWidth: '100%',
    height: '100%',
    gridTitle : '后台账号列表',
    showToolbar: true,
    toolbarItem: '',
    local: 'remote',
    dataUrl: '/admin/system/adminuser-list',
    linenumberAll: false,
    showLinenumber: false,
    showCheckboxcol: true,
    filterThead: false,
    editUrl: '/admin/system/adminuser-edit',
    editCallback:editCallback,
    delUrl:'/admin/system/adminuser-delete',
    delConfirm: true,
}">
    <thead>
    <tr>
        <th data-options="{name:'username',align:'center'}">用户名</th>
        <th data-options="{name:'role_id',items:{{$role_json}},align:'center'}">角色名</th>
        <th data-options="{name:'company_id',items:{{$company_json}},align:'center'}">厂名</th>
        <th data-options="{align:'center',width:200,render:permission_assignment}">设置</th>
    </tr>
    </thead>
</table>
<script type="text/javascript">

    function editCallback( json ){
        BJUI.navtab('reload');
    }
    function permission_assignment(value, data)
    {
        var html      = '<button type="button" class="btn btn-info" data-toggle="dialog" data-options="';
            html      += '{id:\'system-adminuser-edit-dialog\',title:\'设置 '+ data.title +' 登录账号\',';
            html      += 'fresh:true,width:570,';
            html      += 'url:\'/admin/system/adminuser-edit\',data:{id:' + data.id + ',ftype:1}}';
            html      += '">修改密码</button>';
        return html;
    }
</script>